package top.toptimus.dto.project.tree.value;

/**
 * @author zhangtianlong
 */
public class IntValue extends Value {

    private int i;

    public IntValue() {
    }

    public IntValue(int i) {
        this.i = i;
    }

    public int getInt() {
        return i;
    }

    public void setInt(int i) {
        this.i = i;
    }

    @Override
    public int getLength() {
        return 1 + 4;
    }

    @Override
    public byte getType() {
        return INT;
    }

    @Override
    public int compare(Value value) {
        return Integer.compare(i, ((IntValue) value).getInt());
    }

    @Override
    public Object getContent() {
        return 0;
    }

    @Override
    public String toString() {
        return String.valueOf(i);
    }
}
